public class TestPerformance {
	public void testOnce() {
		long start_tme;
		long stop_time;
		String teststring;
		String temp = "";
		// start
		start_tme = System.currentTimeMillis();
		{
			/** Ҫ���Ե�����1 */
			for (int i = 0; i < 1000000; i++) {
				teststring = "12345678901234567890";
				temp = teststring.substring(5);
			}
		}
		stop_time = System.currentTimeMillis();
		System.out.println(stop_time - start_tme);

		// start2
		start_tme = System.currentTimeMillis();
		{
			/** Ҫ���Ե�����2 */
			for (int i = 0; i < 1000000; i++) {
				teststring = "12345678901234567890";
				temp = String.copyValueOf(teststring.toCharArray(), 6, teststring.length() - 6);
			}
		}
		stop_time = System.currentTimeMillis();
		System.out.println(stop_time - start_tme);

	}

	public void testCallEmptyMethod() {
		testStep1();
		testStep2();
	}

	public void testStep1() {
		long start_tme;
		long stop_time;

		/** test 1 */
		start_tme = System.currentTimeMillis();
		{
			for (int i = 0; i < 1000000000; i++) {
				// loop 1000000 times for null;
			}
		}
		stop_time = System.currentTimeMillis();
		System.out.println(stop_time - start_tme);
	}

	public void testStep2() {
		long start_tme;
		long stop_time;
		/** test 2 */
		TestPerformance t = new TestPerformance();
		start_tme = System.currentTimeMillis();
		{
			for (int i = 0; i < 1000000000; i++) {
				t.emptyMethod();
			}
		}
		stop_time = System.currentTimeMillis();
		System.out.println(stop_time - start_tme);
	}

	public void emptyMethod() {

	}

	public static void main(String[] args) {
		TestPerformance t = new TestPerformance();
		t.testCallEmptyMethod();
	}

}
